export default {
  // 命名空间
  namespaced: true,

  state: {
    count: 1,
  },

  getters: {
    doubleCount(state) {
      return state.count * 2;
    },
    msg() {
      return "counter";
    },
  },

  mutations: {
    increment(state) {
      state.count++;
    },
  },

  actions: {
    incrementAsync({ commit }) {
      setTimeout(() => {
        commit("increment");
      }, 1000);
    },
  },
};
